<template>
  <div class="box">
    <el-container>
      <el-aside width="200px">
        <el-radio-group v-model="isCollapse" style="margin-bottom: 100px;">
          <el-radio-button :label="false">展开</el-radio-button>
          <el-radio-button :label="true">收起</el-radio-button>
        </el-radio-group>
        <el-menu
          default-active="/cy"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
          :collapse="isCollapse"
          :router="true"
        >
          <el-menu-item index="/cy">
            <i class="el-icon-menu"></i>
            <span slot="title">类别管理</span>
          </el-menu-item>
          <el-menu-item index="/dpbp">
            <i class="el-icon-document"></i>
            <span slot="title">店铺必备</span>
          </el-menu-item>
          <el-menu-item index="/jtbb">
            <i class="el-icon-setting"></i>
            <span slot="title">家庭必备</span>
          </el-menu-item>
          <el-menu-item index="/ydbb">
            <i class="el-icon-star-off"></i>
            <span slot="title">运动必备</span>
          </el-menu-item>
          <el-menu-item index="/tzzq">
            <i class="el-icon-help"></i>
            <span slot="title">套装专区</span>
          </el-menu-item>
          <el-menu-item index="/pjzq">
            <i class="el-icon-bell"></i>
            <span slot="title">配件专区</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <el-container>
        <el-header>萤石商城后台管理系统</el-header>
        <el-main>
          <router-view></router-view>
        </el-main>
        <el-footer>2019.8.6</el-footer>
      </el-container>
    </el-container>
  </div>
</template>


<style>
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 400px;
}
</style>

<script>
export default {
  data() {
    return {
      isCollapse: true
    };
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    }
  }
};
</script>
<style scoped>
.el-radio-group {
  margin-bottom: 110px;
}
.el-menu-vertical-demo.el-menu {
  margin-top: -100px;
}
.el-aside {
  min-width: 201px;
}
.box,
.el-container {
  height: 100%;
}
.el-header,
.el-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #fff;
  color: #333;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>
